/**
 * File: FilebasedContigMapIdx.java
 * Created by: mhaimel
 * Created on: 21 Jul 2009
 * CVS:  $Id: FilebasedContigMapIdx.java,v 1.1 2009/08/05 15:16:12 mhaimel Exp $
 */
package uk.ac.ebi.curtain.util.impl;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.concurrent.atomic.AtomicReference;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import uk.ac.ebi.curtain.util.ContigMapIndex;
import uk.ac.ebi.curtain.utils.file.maq.MaqFlag;
import uk.ac.ebi.curtain.utils.io.MultipleFileHandler;
import uk.ac.ebi.curtain.utils.io.MultipleFileHandler.FileAccess;
import uk.ac.ebi.curtain.utils.io.impl.FileIO;

/**
 * @author mhaimel
 *
 */
public class FilebasedContigMapIdx implements ContigMapIndex {
	private Log log = LogFactory.getLog(this.getClass());
	
	private MultipleFileHandler<PrintWriter, Integer> printWriter = 
		new MultipleFileHandler<PrintWriter, Integer>(
				new FileAccess<PrintWriter>(){
					public PrintWriter openFile(File file) throws IOException {
						return new FileIO(file).getPrintWriter();
					}
				});
	private AtomicReference<MultipleFileHandler<PrintWriter, Integer>> printWriterRef = 
		new AtomicReference<MultipleFileHandler<PrintWriter,Integer>>(
				new MultipleFileHandler<PrintWriter, Integer>(
						new FileAccess<PrintWriter>(){
							public PrintWriter openFile(File file) throws IOException {
								return new FileIO(file).getPrintWriter();
							}
						}));

	/**
	 * {@inheritDoc}
	 */
	public void addIndex(String contigStr, Integer contigId, String readId,
			MaqFlag flag) {
		// TODO Auto-generated method stub

	}

	/**
	 * {@inheritDoc}
	 */
	public void close() throws IOException {
		// TODO Auto-generated method stub

	}
}
